package cn.wolfcode.trip.base.domain;

import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

//用户对象
@Setter@Getter
public class User extends BaseDomain {
    public static final Integer GENDER_NONE = 0; //保密
    public static final Integer GENDER_MALE = 1; //男
    public static final Integer GENDER_FEMALE = 2; //女

    private String email; //邮箱,作为账号登录

    private String nickName; //昵称

    private String password; //密码

    private String place; //地方

    private String headImgUrl; //头像

    private Integer gender = GENDER_NONE; //性别

    private String coverImgUrl; //封面

    private String sign; //个性签名

    //一对多的关系,由用户来维护表的关系
    public List<New> news = new ArrayList<>();

    public String getGenderName() {
        String msg = "保密";
        if (gender == GENDER_MALE) {
            msg = "男";
        } else if (gender == GENDER_FEMALE) {
            msg = "女";
        }
        return msg;
    }
}